//
//  TableViewDataSource.h
//  TableViewDataSource
//
//  Created by hibo on 2019/6/10.
//  Copyright © 2019 hibo. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

typedef void (^TableViewCellConfigureBlock)(id cell, id model, NSIndexPath * indexPath);
NS_ASSUME_NONNULL_BEGIN

@interface TableViewDataSource : NSObject<UITableViewDataSource>
@property (nonatomic,strong)NSArray *dataArr;//数据源

#pragma mark - source初始化将主要参数引出在主视图中处理数据展示
-(instancetype)initWithDataArr:(NSArray *)dataArr identifier:(NSString *)identifier  configureCellBlock:(TableViewCellConfigureBlock)configureCellBlock;

@end

NS_ASSUME_NONNULL_END



//获取行高
typedef CGFloat (^TableViewRowHeightBlock)(NSIndexPath *indexPath);
//获取头视图高
typedef CGFloat (^TableViewHeaderHeightBlock)(NSInteger section);
//获取尾视图高
typedef CGFloat (^TableViewFooterHeightBlock)(NSInteger section);
//获取头视图view
typedef UIView *(^TableViewHeaderBlock)(NSInteger section);
//获取尾部试图view
typedef UIView *(^TableViewFooterBlock)(NSInteger section);
//delegate
@interface TableViewDelegate : NSObject<UITableViewDelegate>

//初始化行高、组高、头视图、尾部视图
-(instancetype)initWithRowHeight:(TableViewRowHeightBlock)rowHeightBlock
                   headerHeight:(TableViewHeaderHeightBlock)headerHeightBlock
                   footerHeight:(TableViewFooterHeightBlock)footerHeightBlock
                          header:(TableViewHeaderBlock)headerBlock
                          footer:(TableViewFooterBlock)footerBlock;

@end
